/*
 * @name: **列表
 * @content: 
 * @Author: joyce
 * @Date: 2020-08-13 11:40:08
 */
let mongoose = require("mongoose");

module.exports = app => {
  let mongodbUrl =
  "mongodb://zhuhaigangbei:zhuhaigangbei888@47.106.137.50:27017/zhuhaigangbei";
//"mongodb://127.0.0.1:27017/zhuhaigangbei"; 

  mongoose.connect(
    mongodbUrl,
    {
      useNewUrlParser: true,
      useUnifiedTopology: true
    },
    err => {
      if (err) {
        console.log("数据库链接失败:", err);
      }
    }
  );

  mongoose.connection.once("open", () => {
    console.log("数据库链接成功");
  });
};
